<%-- 
    Document   : paquetes
    Created on : 05-feb-2015, 0:23:27
    Author     : Leonardo
--%>


<ol class="breadcrumb">
    <li>Configuraciones</li>
    <li class="active">Paquetes</li>
</ol>

<div class="row">
    <div class="col-md-12">
        <section class="widget">
            <header>
                <h5>
                    Panel <span class="fw-semi-bold">Paquetes</span>
                </h5>
                <div class="widget-controls">
                    <a href="#" title="Expand" data-widgster="expand" style="display: none;"><i class="glyphicon glyphicon-plus"></i></a>
                    <a href="#" title="Collapse" data-widgster="collapse" style="display: inline;"><i class="glyphicon glyphicon-minus"></i></a>
                </div>
            </header>
            <div class="form-horizontal">
                <div class="widget-body">
                    <fieldset>
                         <div class="form-group">
                            <label class="col-sm-2 control-label">Paquete</label> 
                            <input type="hidden" id="idPaquete">
                            <div class="col-sm-6"> <input type="text" id="paquete" placeholder="Paquete" class="form-control" data-required="true"> </div>
                         </div>
                    </fieldset>
                    <div class="form-actions">
                        <label class="col-sm-2 control-label"></label> 
                        <input type="button" id="guardarPaquete" class="btn btn-success" value="Guardar">
                        <input type="button" id="modificarPaquete" class="btn btn-primary" value="Modificar">
                        <input type="button" id="eliminarPaquete" class="btn btn-danger" value="Eliminar">
                    </div>
                </div>
            </div>
        </section>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <section class="widget">
            <header>
                <h5>
                    Tabla <span class="fw-semi-bold">Paquetes</span>
                </h5>
                <div class="widget-controls">
                    <a href="#" title="Expand" data-widgster="expand" style="display: none;"><i class="glyphicon glyphicon-plus"></i></a>
                    <a href="#" title="Collapse" data-widgster="collapse" style="display: inline;"><i class="glyphicon glyphicon-minus"></i></a>
                </div>
            </header>
            <div class="widget-body">
                <div id="desplegablePaquetes"></div>
            </div>
        </section>
    </div>
</div>
<script>
    javascript: cargaAjax('tablas/tabla.Paquetes.jsp', 'desplegablePaquetes', '');

    function abmPaquetes(xFuncion)
    {
        if($('#paquete').val() == '')
        {
            showMensaje('Debe ingresar Paquete', 'alerta');
        }
        else
        {
            javascript: cargaAjax('intermedio/intermedio.Paquetes.jsp', 'recarga', 
                        'xIdPaquete=' + $('#idPaquete').val() + 
                        '&xNombre=' + $('#paquete').val() + 
                        '&xFuncion='+xFuncion);  
        }
    }

    $('#guardarPaquete').click(function(){
        abmPaquetes(0);
    });

    $('#eliminarPaquete').click(function(){
        abmPaquetes(1);
    });

    $('#modificarPaquete').click(function(){
        abmPaquetes(2);
    });
</script>